import {ref} from 'vue';
import {defineStore} from 'pinia';
import {DeviceEnum} from '@/constants/app-key';

export const useAppStore = defineStore('app', () => {
    /** 设备类型 */
    const device = ref<DeviceEnum>(DeviceEnum.Desktop);

    /** 切换设备类型 */
    const toggleDevice = (value: DeviceEnum) => {
        device.value = value;
    };

    return {device, toggleDevice};
});
